<?php

use hhz\constant\redis\redisKeys;
use Hhz\Redis\newCache;

class SubscribeV2Action extends ActionPlugin
{
    public const USER_LEVEL = self::LEVEL_REGISTER;


    public function main()
    {
        if ($this->uid) {
            $redis = new newCache(redisKeys::KEY_B_CACHE_SUPER_SUBSIDY_DAY_SUBSCRIBE);
            $subKeyPrefix = 'v2-' . $this->uid . '-20221201';
            $data = ['subscribe' => 1];
            $redis->setCache($data, $subKeyPrefix);
            $redis->setExpireTime(86400 * 7, $subKeyPrefix);
        }
        $this->setSuccess([]);
    }
}